/**
 * @description 递归树接口返回
 * @param {Array} menuList 接口菜单列表
 * @param {Object} result 输出的结果
 * @param {Array} parent 父级菜单
 * @returns object
 */
export const getTreeList = (list: any = [], valueKey: string = "id", labelKey: string = "name", disabledKey?: string) => {
	return list.map((item: any) => {
		return {
			value: item[valueKey],
			label: item[labelKey],
			disabled: disabledKey && disabledKey == item[valueKey],
			children: item.children ? getTreeList(item.children, valueKey, labelKey, disabledKey) : ""
		};
	});
};
